//
//  DDHotmusicCell.m
//  DDMusic
//
//  Created by rimi on 16/11/10.
//  Copyright © 2016年 FengBaoFamily. All rights reserved.
//

#import "DDHotmusicCell.h"
#import <UIImageView+WebCache.h>

@implementation DDHotmusicCell

- (void)setMusics:(DDHotmusicModel *)musics{
    _musics = musics;
    [_imageIcon sd_setImageWithURL:[NSURL URLWithString:_musics.albumpic_small] placeholderImage:[UIImage imageNamed:@"占位.jpg"]];
    _singerName.text = _musics.singername;
    _musicName.text = _musics.songname;
    int num1 = _musics.seconds.intValue/60;
    int num2 = _musics.seconds.intValue%60;
    if (num2>=10) {
        NSString* musicTime = [NSString stringWithFormat:@"0%d:%d",num1,num2];
        _album.text = musicTime;
    }else if (num2>0 && num2<10){
        NSString* musicTime = [NSString stringWithFormat:@"0%d:0%d",num1,num2];
        _album.text = musicTime;
    }else{
        NSString* musicTime = [NSString stringWithFormat:@"0%d:00",num1];
        _album.text = musicTime;
    }

}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
